<?php
class MyAdminController extends MyController
{
	public function init()
	{
		parent::init();

		//后台管理布局
		Yii::app()->setLayoutPath(Yii::app()->basePath.'/views/layouts');

		if((substr(Yii::app()->request->pathInfo, 0, 10) != 'site/login' &&  substr(Yii::app()->request->pathInfo, 0, 12) != 'site/seccode') && (!Yii::app()->user->getState('admin_is_login') || Yii::app()->user->isGuest))
		{
			Yii::app()->request->redirect('/site/login');
		}
	}

	/**
	 * 验证码
	 */
	public function actions() {
		return array(
		'captcha'=> array(
		'class' => 'CCaptchaAction',//加载外部的action class
		'backColor' => 0xffffff,//设置验证码图片背景色属性
		'width' => 90,
		'height' => 33,
		'padding' => 0,
		//'transparent' => TRUE,// 是否需要刷新按钮
		'testLimit' => 10,//三次输入错误时就换一张
		'transparent' => TRUE,//显示为透明*/
		),
		);
	}
}